//package wechat.snd.domain
//
//import java.util.Date
//import org.apache.log4j.Logger
//import wechat.snd.WCApplicationFactory
//import wechat.snd.WCServiceAppFactory
//import wechat.snd.WCTemplateContent
//import wechat.snd.util.TimeFormatter
//
//import static wechat.snd.domain.ScheduledTaskNotify.*
//
//class ScheduledTaskNotify {
//	private static String CALLBACK_SERVER_URL = "http://58.247.87.218:8090"
//	private static String ROUTE_TASKDETAILS = "taskdetails"
//	static Logger logger = Logger::getLogger("ScheduledTaskNotify")
////	private static String SERVICE_APP_TEMPLATE_DISPATH_MSG_URL = "http://58.247.87.218/data?evtid="; //lanmon
//	private static String SERVICE_APP_TEMPLATE_DISPATH_MSG_URL = "http://operation.linemore.com/customertaskdetails"; //lanmon
//	private static String SERVICE_APP_TEMPLATE_DISPATH_MSG_URL_NO_AUTH = "http://operation.linemore.com/customertaskdetails_ext"; //lanmon
//	def static sendMsg( String wechatid, String eventId, String projectName, String taskDesc){
//		WCApplicationFactory::testApp=>[
//			createNews()=>[
//				withItem('新消息')=>[
//					url= generateUrl(wechatid, eventId, projectName, taskDesc)
//				]
//				withItem('项目名称: '+projectName+'\n\r任务描述: '+taskDesc)=>[
//					url= generateUrl(wechatid,eventId, projectName, taskDesc)
//				]
//				send2Users(newArrayList(wechatid))
//			]
//		]
//	}
//	//上门时间，报修内容，派遣工程师
//	def static sendTemplateMsg_ServApp(Iterable<String> wechatids, String eventId, Date arrivalTime, String engineerName, String taskDesc){
////		WCServiceAppFactory::serviceApp=>[
////			createNews()=>[
////				withData(new WCTemplateContent()=>[
////					withFirstItem("报修状态如下：")
////					withKeyword1Item(taskDesc)
////					withKeyword2Item(engineerName)
////					withRemarkItem(
////					"上门时间："+TimeFormatter::timeFormat(arrivalTime))
////				])
////				withAuthUrl(SERVICE_APP_TEMPLATE_DISPATH_MSG_URL, eventId)
////				send2Users(wechatids)
////			]
////		]
//		sendTemplateMsg_ServApp_NoAuth(wechatids,eventId,arrivalTime, engineerName,taskDesc)
//	}	
//	
//		//上门时间，报修内容，派遣工程师
//	def static sendTemplateMsg_ServApp_NoAuth(Iterable<String> wechatids, String eventId, Date arrivalTime, String engineerName, String taskDesc){
//		val app = WCServiceAppFactory::serviceApp;
//		wechatids.forEach[user|
//			app.createNews()=>[
//				withData(new WCTemplateContent()=>[
//					withFirstItem("报修状态如下：")
//					withKeyword1Item(taskDesc)
//					withKeyword2Item(engineerName)
//					withRemarkItem(
//					"上门时间："+TimeFormatter::timeFormat(arrivalTime))
//				])
//				withUrl(SERVICE_APP_TEMPLATE_DISPATH_MSG_URL_NO_AUTH+'?evtid='+eventId+'&wechatid='+user)
//				send2Users(newArrayList(user))
//			]
//		]
//	}
//	
////	//上门时间，报修内容，派遣工程师
////	def static sendTemplateMsg_ServApp_ext(String openid, String eventId, Date reportTime, String engineerName, String taskDesc){
////		logger.info("Find a user "+ openid)
////		sendTemplateMsg_ServApp_NoAuth(newArrayList(openid), eventId, reportTime,engineerName,taskDesc)
////	}
//	def static sendTemplateMsg_ServApp_NoAuth_ext(String openid, String eventId, Date reportTime, String engineerName, String taskDesc){
//		logger.info("Find a user "+ openid)
//		sendTemplateMsg_ServApp_NoAuth(newArrayList(openid), eventId, reportTime,engineerName,taskDesc)
//	}
//	def static generateUrl(String wechatid, String eventId,String project_name, String task_desc) {
//			 CALLBACK_SERVER_URL+"/"+ROUTE_TASKDETAILS+"?&assigneeid="+wechatid
//				+"&eventid="+eventId
//				+"&projectname="+project_name
//				+"&taskdesc="+task_desc
//	}
//}